package com.bzgwl.service_order.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Professor_Kong
 * @version 1.0
 * @date 2020/1/8 14:35
 */

@RestController
@RefreshScope  //自动  动态读取更新配置   哪里需要读取配置 加到哪里
public class MainController {

    @Value("${spring.application.name}")
    private String names;

    @Value("${server.port}")
    private String port;

    @Value("${token.key}")
    private String token;

    @RequestMapping("/hi")
    public String say(){
        return "name: "+names +" , and Port is : "+ port +" ,and token is : "+ token;
    }
}
